package com.whmskj.xjlhsc.gongweiji.produce.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.whmskj.xjlhsc.controller.vo.Result;
import com.whmskj.xjlhsc.gongweiji.produce.pojo.dto.*;
import com.whmskj.xjlhsc.gongweiji.produce.service.IGwjemployeeperformanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author jiaruchun
 * @date 2025-09-27 16:03
 */
@SaIgnore
@RestController
@RequestMapping("/gwj/employeeperformance")
public class GwjemployeeperformanceController {

    @Autowired
    private IGwjemployeeperformanceService gwjemployeeperformanceService;
    /*产量绩效日报,分机台*/
    @PostMapping("/daily")
    public Result daily(@RequestBody(required = false) DailyJiXiaoDTO dto) {
        return Result.success(gwjemployeeperformanceService.daily(dto));
    }

    /*根据工序查工种*/
    @GetMapping("/workType")
    public Result workType() {
        return Result.success(gwjemployeeperformanceService.workType());
    }

    /*月绩效工资*/
    @PostMapping("/monthly")
    public Result monthly(@RequestBody(required = false) MonthJiXiaoDTO dto) {
       return Result.success(gwjemployeeperformanceService.monthly(dto));
    }
    /*月绩效工资详情*/
    @PostMapping("/monthly/detail")
    public Result monthlyDetail(@RequestBody(required = false) MonthJiXiaoDetailDTO dto) {
        return Result.success(gwjemployeeperformanceService.monthlyDetail(dto));
    }

    /*工人月产量统计*/
    @PostMapping("/monthly/yield")
    public Result monthlyYield(@RequestBody(required = false) MonthJiXiaomonthlyYieldDTO dto) {
        return Result.success(gwjemployeeperformanceService.monthlyYield(dto));
    }

    /*工人月产量统计详情*/
    @PostMapping("/monthly/yield/detail")
    public Result monthlyYieldDetail(@RequestBody(required = false) MonthJiXiaomonthlyYieldDetailDTO dto) {
        return Result.success(gwjemployeeperformanceService.monthlyYieldDetail(dto));
    }

    /*工人上班时间统计*/
    @PostMapping("/monthly/worktime")
    public Result monthlyWorktime(@RequestBody(required = false) MonthJiXiaomonthlyWorktimeDTO dto) {
        return Result.success(gwjemployeeperformanceService.monthlyWorktime(dto));
    }
    /*工人上班时间统计详情*/
    @PostMapping("/monthly/worktime/detail")
    public Result monthlyWorktimeDetail(@RequestBody(required = false) MonthJiXiaomonthlyWorktimeDetailDTO dto) {
        return Result.success(gwjemployeeperformanceService.monthlyWorktimeDetail(dto));
    }

    /*精准计酬表*/
    @PostMapping("/monthly/accuratePay")
    public Result monthlyAccuratePay(@RequestBody(required = false) MonthJiXiaomonthlyAccuratePayDTO dto) {
        return Result.success(gwjemployeeperformanceService.monthlyAccuratePay(dto));
    }

    /*精准计酬表详情*/
    @PostMapping("/monthly/accuratePay/detail")
    public Result monthlyAccuratePayDetail(@RequestBody(required = false) MonthJiXiaomonthlyAccuratePayDetailDTO dto) {
        return Result.success(gwjemployeeperformanceService.monthlyAccuratePayDetail(dto));
    }
}
